#!/bin/bash

# 检查IPv4安全ICMP重定向是否已禁用
if [[ $(sysctl -n net.ipv4.conf.all.secure_redirects 2>/dev/null) -eq 0 ]]; then
    echo "通过：IPv4 all secure_redirects 已禁用"
else
    echo "失败：IPv4 all secure_redirects 未禁用"
    exit 1
fi

if [[ $(sysctl -n net.ipv4.conf.default.secure_redirects 2>/dev/null) -eq 0 ]]; then
    echo "通过：IPv4 default secure_redirects 已禁用"
else
    echo "失败：IPv4 default secure_redirects 未禁用"
    exit 1
fi
